<div class="row contentBox">
    <app-sidebar-theme></app-sidebar-theme>
    <div [ngClass]="{'contentArea_rightDiv_project right-full':isActive, 'contentBox_project right-off':!isActive }">
        <div class="row txtTitle">

            <div class="form-group pull-left form-span " (click)="openSearch()" style="line-height: 30px;margin-right: 5px;margin-bottom: 0px;">
                <a href="javascript:;" class="animate-time opensearcha">{{opensearchtitle}}</a>
                <img class="animate-time" [ngClass]="{ 'down': opensearch , 'up': !opensearch}" height="20px" width="20px" src="assets/indexing/zk.png">
            </div>

            <input type="text" class="input_style input_width" placeholder="请输入主题词表名称" name="searchData" *ngIf="right['systemTable']['query']" [(ngModel)]="searchData" (input)="changesearch()" (keyup.enter)="changesearch()">
            <button class="btn btn-search btn-blue" mat-button (click)="search()" *ngIf="right['systemTable']['query']">检索</button>

            <button class="btn btn-blue" mat-button data-toggle="modal" *ngIf="right['systemTable']['create']" (click)="initService._init(1);" data-target="#add">新增</button>
            
            <button class="btn btn-orange"
                    mat-button
                    data-toggle="modal"
                    [disabled]="removeTableService?._isEmpty()"
                    data-target="#delete"
                    *ngIf="right['systemTable']['batchDelete']"
            >删除</button>

            <button
                    class="btn btn-green"
                    mat-button
                    [disabled]="removeTableService?._isEmpty()"
                    (click)="_enable(0)"
                    *ngIf="right['systemTable']['batchEnable']"
            >启用</button>

            <button
                    class="btn btn-orange"
                    mat-button
                    [disabled]="removeTableService?._isEmpty()"
                    (click)="_disable(-1)"
                    *ngIf="right['systemTable']['batchDisable']"
            >禁用</button>

            <button
                    class="btn btn-green "
                    mat-button
                    [disabled]="removeTableService?._isEmpty()"
                    (click)="_checkstatus(1)"
                    *ngIf="right['systemTable']['batchReview']"
            >审核</button>

            <button
                    class="btn btn-orange"
                    mat-button
                    [disabled]="removeTableService?._isEmpty()"
                    (click)="_checkstatus(0)"
                    *ngIf="right['systemTable']['batchCancelReview']"
            >取消审核</button>
            <button class="btn btn-blue" mat-button
                    *ngIf="right['systemTable']['exportSystemTable']"
                    data-toggle="modal"
                    data-target="#keywordTableExport"
                    (click)="initService._init(1);_clickExport()"
                    [disabled]="false"
            >送发布</button>

            <button class="btn btn-blue" mat-button
                    *ngIf="right['systemTable']['importSystemTable']"
                    data-toggle="modal"
                    data-target="#keywordTableImport"
                    (click)="initService._init(1);_clickExport()"
                    [disabled]="false"
            >上传</button>

            <button class="btn btn-blue" mat-button
                    *ngIf="right['systemTable']['download']"
                    data-toggle="modal"
                    data-target="#keywordTableDownload"
                    (click)="initService._init(1);"
                    [disabled]="false"
            >下载</button>

            <button class="btn btn-blue" mat-button
            *ngIf="right['systemTable']['DownloadTemplate']"
            data-toggle="modal" 
            data-target="#downloadThemeTemplate"
            (click)="initService._init(1);"
            >下载模板</button>

        </div>

        <div class="row txtTitle themeSearch animate-time" *ngIf="right['systemTable']['query']" [ngClass]="{ 'opens': opensearch , 'closes': !opensearch}">
            <div class="form-group pull-left">
                <span class="pull-left form-span span_left_search">启用状态：</span>
                <select name="status" [(ngModel)]="status"  (change)="search()" class="pull-left fill form-control select-style select_width">
                    <option value="">全部</option>
                    <option value="0">启用</option>
                    <option value="-1">禁用</option>
                </select>

                <span class="pull-left form-span span_left_search">审核状态：</span>
                <select name="checkstatus" [(ngModel)]="checkstatus"  (change)="search()" class="pull-left fill form-control select-style select_width">
                    <option value="">全部</option>
                    <option value="1">已审核</option>
                    <option value="0">未审核</option>
                    <option value="-1">不通过</option>
                </select>
            </div>

            <div class="form-group pull-left">
                <span class="pull-left form-span span_left_search">标签：</span>
                <select class="form-control select-style" name="labelId" (change)="search()" [(ngModel)]="labelId">
                    <option value="">全部</option>
                    <option *ngFor="let val of themeTableTagListVal" value="{{ val.labelId }}">{{ val.labelName }}</option>
                </select>
            </div>
        </div>

        <!-- 表格 BEGIN -->
        <app-keyword-table-table #table
                                 [tableNumber]="tableNumber"
                                 (tabeListOutput)="ParentList($event)"
                                 (detailsOutput)="ParentDetails($event)"
                                 (isSelectFromTable)="isSelectFromTableHandler($event)"
        >
        </app-keyword-table-table>
        <!-- 表格 END -->

        <!-- 分页 BEGIN -->
        <app-pagination [getTotalItems]="this.table.totalItems" (isLoadTableFromPagination)="isLoadTableFromPaginationHandler($event)"></app-pagination>
        <!-- 分页 END -->
    </div>
</div>
<!--content  end-->


<!--新增弹窗 开始-->
<app-keyword-table-add [details]="details" [themeTableTagListVal]="themeTableTagListVal" (addOutput)="ParentAdd($event)"></app-keyword-table-add>
<!--新增弹窗 结束-->

<!--details-->
<app-keyword-table-details [details]="details"  [themeTableTagListVal]="themeTableTagListVal"></app-keyword-table-details>
<!--details end-->

<!--编辑弹窗 开始-->
<app-keyword-table-edit [details]="details"  [themeTableTagListVal]="themeTableTagListVal" (editOutput)="ParentEdit($event)"></app-keyword-table-edit>
<!--编辑弹窗 结束-->

<!-- 删除 BEGIN -->
<app-keyword-table-delete (deleteOutput)="ParentDelete($event)"></app-keyword-table-delete>
<!-- 删除 END -->

<!-- 导出 BEGIN -->
<app-keyword-table-export></app-keyword-table-export>
<!-- 导出 BEGIN -->

<!-- 导入 BEGIN -->
<app-keyword-table-import (inportOutput)="ParentDelete($event)"></app-keyword-table-import>
<!-- 导入 BEGIN -->

<!-- 下载主题词表 BEGIN -->
<app-keyword-table-download></app-keyword-table-download>
<!-- 下载主题词表 BEGIN -->

<!-- 下载模板提示 -->
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static"
    aria-labelledby="myModalLabel" aria-hidden="true" id="downloadThemeTemplate">
    <div class="modal-dialog delete-modal modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title text-center">下载提示</h4>
            </div>
            <div class="modal-body text-center">
                <p class="delete-prompt">请确认是否下载主题词表模板！</p>
            </div>
            <div class="modal-footer" style="width: 100%;">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" (click)="download()">确认</button>
            </div>
        </div>
       
    </div>
</div>
<!-- 下载模板提示 -->